Skip to content

fix(process): match Node property descriptors - #102

Merged
steipete merged 2 commits into
mainfrom
claude/w131-process-descriptors
Oct 4, 2026
Merged

steipete merged 2 commits into
mainfrom
claude/w131-process-descriptors

Conversation

@steipete

@steipete steipete commented Oct 4, 2026 •

Copy link
Copy Markdown

Process properties now expose Node-compatible descriptors, so code can preserve a descriptor while replacing its value:

const descriptor = Object.getOwnPropertyDescriptor(process, "argv");
Object.defineProperty(process, "argv", { ...descriptor, value: ["node", "fixture.js"] });

Bun previously exposed argv as an accessor, making this valid Node pattern throw before the property could be changed. argv and execArgv now materialize as lazy data properties; native consumers read the public property instead of a separate stale cache. This also preserves throwing getters and makes the inspector check the replacement's type before treating it as an array.

The Node 24 comparison covered platform, arch, version, versions, env, execPath, argv, pid, ppid, title, exitCode, release, and the sibling execArgv. Six metadata properties now have Node's read-only flag while remaining configurable. ppid and title retain live native behavior behind data descriptors. env, execPath, and exitCode already matched.

Ports the argv portion of oven-sh/bun#44356 and the relevant metadata attributes from oven-sh/bun#34229; both remain open. Thanks @robobun. The unrelated environment-map changes are not included, and this requires no WebKit changes.

Validation on one dedicated Linux host:

  • Dependency-free Node v24.19.0 oracle: all 13 descriptors and replacement/restoration checks pass after the fix; c999 and unpatched main mismatch ten properties.
  • New regression tests fail on c999 and pass patched, including native parseArgs() reads after descriptor replacement and throwing getters.
  • The surrounding process, argument-parser, and worker suites pass 588 tests with five existing skips. These suites use the repository-pinned Node 26 host tool; the semantic oracle and consumer controls remain Node 24.
  • At OpenClaw affb994cf4193ff967b0f792b4634435d3942948, extension-install-external.test.ts, extension-windows-host.test.ts, and browser-cli-extension.windows-setup.test.ts pass 43/43 on Node 24 and patched Bun; c999 passes 15 and fails 28. Bun runs set OPENCLAW_VITEST_RUNTIME=bun, private HOME/state/TMPDIR, and umask 022.
  • The combined final head 33eec2f6d4142b134edcee549defdf1ca86bed27 passes 1,094 surrounding tests (six existing skips), both dependency-free oracles, and all four OpenClaw consumer files (48/48).
  • Scoped P2 branch review is clean. The branch includes the landed listen fix from fix(node:net): validate listen ports synchronously #101; the process runtime and test changes were preserved byte-for-byte during rebase.

The fork changelog is append-only. Linux x64 and macOS arm64 CI both passed on exact head 33eec2f6d4142b134edcee549defdf1ca86bed27; format and JavaScript lint also passed. The optional Claude workflow fails at credential validation before analysis (existing fork setup issue).

Expose Node-compatible data descriptors for process metadata and lazy argument arrays. Read replaced argv values through the public property in native consumers and keep dynamic title and parent PID behavior behind native data descriptors.

Ports the argv portion of oven-sh#44356 and metadata attributes from oven-sh#34229.
Use a strict Function constructor for readonly writes and execute the native argv reader fixture as a script, matching the Node 24 controls. Scope the compatibility note to the measured metadata properties.
@steipete
steipete merged commit 372d569 into main Oct 4, 2026
8 of 9 checks passed
@steipete
steipete deleted the claude/w131-process-descriptors branch October 4, 2026 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant